import { http } from '@/utils/http/axios'

const baseUrl = '/file'

export default {
  uploadFile: ({ data, cancelToken, onUploadProgress }) => {
    console.log('cancelToken.toString()', cancelToken.toString())
    return http.post(
      {
        url: `${baseUrl}/upload`,
        data,
        onUploadProgress,
        headers: { 'Content-Type': 'multipart/form-data' },
        cancelToken
      },
      { isTransformResponse: true, ignoreCancelToken: false }
    )
  }
}
